<?php
	session_start();
	//error_reporting(0);// turn off errors on release
    $settings = parse_ini_file('troll.ini',true);
    require 'includes/dbconnect.php';
    require 'includes/functions.php';

    /** only way to here is from town or player select **/ 
    if(
		isset($_SESSION['curr_location']) &&
	   (
		$_SESSION['curr_location'] == 'village' ||
		$_SESSION['curr_location'] == 'playerselect'
		)
	   )
    {
    	$c = getCharacterRecord($_SESSION['id']);

 ?>

 <html>
		<head>
    		<link rel="stylesheet" type="text/css" href="scripts/troll.css"/>
    		<title>TROLL: Characater Creation</title>

    		<script src="scripts/hotkeys.js" type="text/javascript"></script>
    		<script type="text/javascript">
        		shortcut.add("b",function() {window.location.assign("town.php");});
    		</script>
    		<NOSCRIPT><font color="RED">Java Script Required to Play</font></NOSCRIPT>
		</head>
		<body>
    		<center>
    		<div class="console">        
        		<table width="800" clas="console">
            		<tr>
                		<td>                
                    		<center>	                    		
								
								<h2><font color="#FFF"><?=$c['name'];?>'s CHARACTER PROFILE</font></h2>
								<?=str_repeat("-=", 39);?>-<br/>
								<table>
									<tr>
										<td><?=lwriteln('`2Experience`8:');?> </td><td><font color="lime"><?=number_format($c['xp']);?></font></td><td width="50"></td>
										
									</tr>
									<tr>
										<td><?=lwriteln('`2Level`8:');?> </td><td><font color="lime"><?=$c['level'];?></font></td><td width="50"></td>
										<td><?=lwriteln('`2Hit Points`8:');?>	</td><td><font color="lime"><?=$c['hp'].' of '.$c['hpMax'];?></td>
									</tr>
									<tr>
										<td><?=lwriteln('`2Exploration Turns`8:');?> </td><td><font color="lime"><?=$c['pve'];?></td><td width="50"></td>
										<td><?=lwriteln('`2Player vs Player`8:');?>	</td><td><font color="lime"><?=$c['pvp'];?></td>
									</tr>
									<tr>
										<td><?=lwriteln('`2Gold In Hand`8:');?> </td><td><font color="lime"><?=number_format($c['gold']);?></td><td width="50"></td>
										<td><?=lwriteln('`2Gold In Bank`8:');?></td><td><font color="lime"><?=number_format($c['goldInBank']);?></td>
									</tr>
									<tr>
										<?php
											$i = getItemRec($c['weaponId'],'weapon');
											if($i == null) 
												{
													$iName = 'Nothing!';
													$value = '0';
												}
												else
												{
													$iName = $i['name'];
													$value = $i['value'];
												}
										?>
										<td><?=lwriteln('`2Weapon`8:');?></td><td><font color="lime"><?=$iName;?></td><td width="50"></td>
										<td><?=lwriteln('`2Combat Value`8:');?>	</td><td><font color="lime"><?=number_format($c['strength']+$value);?></td>
									</tr>
									<tr>
										<?php
											$i = getItemRec($c['armorId'],'armor');
											if($i == null) 
												{
													$iName = 'Village Rags!';
													$value = '0';
												}
												else
												{
													$iName = $i['name'];
													$value = $i['value'];
												}
										?>
										<td><?=lwriteln('`2Armor`8:');?></td><td><font color="lime"><?=$iName;?></td><td width="50"></td>
										<td><?=lwriteln('`2Defense Value`8:');?>	</td><td><font color="lime"><?=number_format($c['defense']+$value);?></td>
									</tr>
									<tr>
										<td><?=lwriteln('`2Influence`8:');?></td><td><font color="lime"><?=$c['charm'];?></td><td width="50"></td>
										<td><?=lwriteln('`2Gem`8:');?>	</td><td><font color="lime"><?=$c['gem'];?></td>
									</tr>
								</table>
								<p><a href="town.php" accesskey="B"><?=lwriteln('`8[`$B`8]`2ack to town');?></a></p>
							</center>	
						</td>
					</tr>	
				</table>
			</div>	
			</center>
		</body>	
		</html>	
 <?php 
    }
?>